var https = require('https');
var fs = require('fs');
var options = {
      hostname: "localhost",
      port: 8000,
      path: '/',
      methed: 'GET',
      // 当前为非严格 ssl , 所以 客户端的 key,cert 可以去除,但是ca证书不可以
      key: fs.readFileSync('./ssl/client-key.pem'),
      cert: fs.readFileSync('./ssl/client.pem'),
      ca: [fs.readFileSync('./ssl/ca.pem')]

};
options.agent = new https.Agent(options);
var req = https.request(options, function(res) {
      res.setEncoding('utf-8');
    res.on('data', function(d) {
            console.log(d);
          
    });

});
req.end();
req.on('error', function(e) {
      console.log(e);

});
